<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //parseInt();取整，不识别小数点,非严格,一位一位的往下读
        // var a="345.678"
        // console.log(a)
        // console.log(parseInt(a));
        //parseFloat();取小数，非严格，识别小数点
        // var a="345.678"
        // console.log(a)
        // console.log(parseFloat(a));
        //Math.round();严格，四舍五入最近的整数
        // var a="-345.678"
        // console.log(a)
        // console.log(Math.round(a));
        //Number()严格
        console.log(Number("hello"));
        console.log(Number("123"));
        console.log(Number(true));
        console.log(Number(false));
        console.log(Number(null));
        console.log(Number(undefined));
        console.log(Number(function(){}));
        console.log(Number({}));
        console.log(Number([]));
        console.log(Number([1]));
        console.log(Number([2]));
        console.log(Number([2,3]));
    </script>
</body>
</html>